import method from '@/api/base'
import qs from 'qs'

const findbackPassword = {
  sendEmail: function (app, mailAddr) {
    let params = qs.stringify({
      mailAddr: mailAddr
    })
    console.log(params)
    method.get('/sendFindbackPasswordMail?mailAddr=' + mailAddr, null, app, null)
  },
  changePassword: function (app, password, rePasswordToken) {
    let param = qs.stringify({
      rePasswordToken: rePasswordToken,
      newPassword: password
    })
    method.post('/findbackPassword', param, (resp) => {
      let code = resp.data.data.code
      console.log(code)
    }, null, app)
  }
}

export default findbackPassword
